<?php
/**
 * 管理员基本控制器
 * 
 * @author ShuangYa
 * @package EasyAccountCenter
 * @category Controller
 * @link https://www.sylingd.com/
 * @copyright Copyright (c) 2017 ShuangYa
 * @license https://www.sylibs.com/go/easyaccount/license
 */

class Sy_ControllerAdmin extends Sy_ControllerBase {
	public function checkAdmin($is_return = FALSE) {
		$valid = $this->checkLogin(TRUE) && $this->is_admin;
		if (!$valid) {
			if ($is_return) {
				return FALSE;
			} else {
				$this->message('您不是管理员，无权查看此页面');
				exit;
			}
		} else {
			return TRUE;
		}
	}
}